import { http } from "@/utils/http";
import type { AxiosResultDefault, TreeDataType, TableItem, TableType } from "../type";

// 根据当前登录人获取科室列表
export const queryClassList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("post", `/account/api/v1/class/query`, { data }, { headers: { noLoading: true } }, cb);

// 分页查询用户列表
export const queryUserList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<TableType>>("post", `/account/api/v1/user/listPage`, { data }, { headers: { noLoading: true } }, cb);

// 通过管道查询机台信息
export const getFabByPipe = (id: string | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/listFabByPipe/${id}`, {}, { headers: { noLoading: false } }, cb);

// 机台模糊下拉
export const getFabNameOptions = (fabName: string | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>("get", `/fab/api/v1/spcIndicator/getFab/${fabName}`, {}, { headers: { noLoading: false } }, cb);

// 关联过的机台id的查询
export const getgetQuotaNameOptions = (quotaName: string | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>(
    "get",
    `/fab/api/v1/spcIndicator/getQuotaName/${quotaName}`,
    {},
    { headers: { noLoading: false } },
    cb
  );

// 分页查询Fab机台所有信息
export const queryFabList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/pageFabAll`, { data }, { headers: { noLoading: true } }, cb);

// 获取fab机台报警信息列表
export const queryFabAlarmList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/alarm/page`, { data }, { headers: { noLoading: true } }, cb);

// 物料模糊搜索 （异常查询）
export const getFabAlarmMaterialOptions = (params: any | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/alarm/material/list`, { params }, { headers: { noLoading: false } }, cb);

// 报警-弹窗 （异常查询）
export const getFabAlarm24HoursCurve = (params: any | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>("get", `/fab/api/v1/alarm/warning/day/hour/24`, { params }, { headers: { noLoading: false } }, cb);

// 删除设备信息
export const removeFabInfo = (id: string | number | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/removeFab/${id}`, {}, { headers: { noLoading: true } }, cb);

// 删除 alarm 设备
export const removeFabAlarm = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/alarm/delete`, { data }, { headers: { noLoading: true } }, cb);

// 删除设备信息（批量）
export const removeFabInfoBatch = (data: any | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/removeFabBatch`, { data }, { headers: { noLoading: true } }, cb);

// 查询Fab机台详细信息
export const getFabDetail = (eqpId: string | number, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/getFabDetail/${eqpId}`, {}, { headers: { noLoading: false } }, cb);

// 查询Fab机台生产计划信息
export const getFabPlan = (deviceId: string | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/getFabPlan/${deviceId}`, {}, { headers: { noLoading: false } }, cb);

// 上传文件
export const uploadFile = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>(
    "post",
    // `/fab/api/v1/file/upload`,
    `/sharing/api/v1/file/upload`,
    { data },
    {
      headers: {
        noLoading: true,
        "content-type": "application/x-www-form-urlencoded"
      }
    },
    cb
  );

// 查询文件信息接口
export const queryFileList = (data?: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>("post", `/sharing/api/v1/file/query`, { data }, { headers: { noLoading: true } }, cb);

// 创建设备信息
export const createFabInfo = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/addFab`, { data }, { headers: { noLoading: true } }, cb);

// 编辑设备信息
export const editFabInfo = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/updateFab`, { data }, { headers: { noLoading: true } }, cb);

// 获取中台同步的fab所有数据信息用于新建下拉框选择-v0.1新增
export const getFabList = (fabName: string, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/getFab/${fabName}`, {}, { headers: { noLoading: false } }, cb);

// 查询所有管道信息-v0.1更改
export const getPipeList = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<TreeDataType>("get", `/fab/api/v1/publish/list/system/takeOff`, { params }, { headers: { noLoading: false } }, cb);

// 今日机台状态统计-v0.2新增
export const getFabStatus = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/statistics/status/total`, { params }, { headers: { noLoading: false } }, cb);

// 今日机台保养任务统计-v0.2新增
export const getFabUpkeep = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/statistics/pm/day/total`, { params }, { headers: { noLoading: false } }, cb);

// 今日机台维修任务统计-v0.2新增
export const getFabRepair = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/statistics/maintain/day/total`, { params }, { headers: { noLoading: false } }, cb);

// 机台分布饼状图统一接口-v0.2新增
export const getFabDistribute = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("get", `/fab/api/v1/statistics/distribute`, { params }, { headers: { noLoading: false } }, cb);

// 日用量统计-消耗资源类型分类(柱状图)-v0.2新增
export const getFabConsume = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>(
    "get",
    `/fab/api/v1/statistics/gas/consume/type/day`,
    { params },
    { headers: { noLoading: false } },
    cb
  );

// 日用量统计-排放+回收资源类型分类(柱状图)-v0.2新增（气化课）
export const getFabEmissionAndRecovery = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>(
    "get",
    `/fab/api/v1/statistics/gas/emissionAndRecovery/type/day`,
    { params },
    { headers: { noLoading: false } },
    cb
  );

// 日用量统计-排放+回收资源类型分类(柱状图)-v0.2新增（机械课）
export const getFabMachineEmissionAndRecovery = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>(
    "get",
    `/fab/api/v1/statistics/mac/emissionAndRecovery/type/day`,
    { params },
    { headers: { noLoading: false } },
    cb
  );

// 日用量统计-消耗资源时间段分类(折线图)-v0.2新增
export const getFabPCWEConsume = (params: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>(
    "get",
    `/fab/api/v1/statistics/mac/pcw/consume/every/hour`,
    { params },
    { headers: { noLoading: false } },
    cb
  );

// 24小时机台纯水用量（水课）
export const getFabWaterConsume = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>(
    "get",
    `/fab/api/v1/statistics/water/consume/Upw/every/hour`,
    { params },
    { headers: { noLoading: false } },
    cb
  );
// 24小时机台废水排放量（水课）
export const getFabWaterEmissionConsume = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>(
    "get",
    `/fab/api/v1/statistics/water/emission/every/hour`,
    { params },
    { headers: { noLoading: false } },
    cb
  );

// 机台近七天电量消耗（电课）
export const getFabElectricityConsume = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>(
    "get",
    `/fab/api/v1/statistics/ele/consume/seven/day`,
    { params },
    { headers: { noLoading: false } },
    cb
  );

// 今日机台总体供电情况(折线图)-v0.2新增
export const getFabTotalEConsume = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>("get", `/fab/api/v1/statistics/ele/day/every/hour`, { params }, { headers: { noLoading: false } }, cb);

// 各科能源消耗列表-v0.2新增
export const queryFabConsumeList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/statistics/consume/page`, { data }, { headers: { noLoading: true } }, cb);

// 各科能源排放列表-v0.2新增
export const queryFabEmissionList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/statistics/emission/page`, { data }, { headers: { noLoading: true } }, cb);

// pm gantt Search plan 甘特图 （厂务 PMS）
export const queryFactoryPMGanttList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/pm/device/gantt`, { data }, { headers: { noLoading: true } }, cb);

// pm Search plan 列表 （厂务 PMS）
export const queryFactoryPMList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/pm/device/list`, { data }, { headers: { noLoading: true } }, cb);

// pm Search plan 列表 （厂务 PMS）
export const getFabPMCategorySelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>("get", `/fab/api/v1/pm/device/category/list`, { params }, { headers: { noLoading: true } }, cb);

// 机台保养信息 甘特图 （fab 机台）
export const queryFabPMGanttList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/pm/eqp/gantt`, { data }, { headers: { noLoading: true } }, cb);

// 机台保养信息 列表 （fab 机台）
export const queryFabPMList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/pm/eqp/list`, { data }, { headers: { noLoading: true } }, cb);

// 机台保养信息 详情 （fab 机台）
export const getFabPMDetail = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("get", `/fab/api/v1/pm/eqp/detail`, { params }, { headers: { noLoading: true } }, cb);

// 设备保养信息 详情 （fab 机台）
export const getFactoryPMDetail = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("get", `/fab/api/v1/pm/device/detail`, { params }, { headers: { noLoading: true } }, cb);

// 通过机台id获取设备id，或者通过设备id获取机台id （fab 机台）
export const queryFabFactoryRelationIds = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TreeDataType>("post", `/fab/api/v1/publish/getRelation`, { data }, { headers: { noLoading: false } }, cb);

// 供应与使用查询区域级别 （fab 机台）
export const queryFabSupplyConsumeArea = (data?: Record<string, any> | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/supplyConsume/area`, { data }, { headers: { noLoading: false } }, cb);

// 供应与使用查询fab级别 （fab 机台）
export const queryFabSupplyConsumeFab = (data?: Record<string, any> | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/supplyConsume/fab`, { data }, { headers: { noLoading: false } }, cb);

// 供应与使用查询chamber级别 （fab 机台）
export const queryFabSupplyConsumeChamber = (data?: Record<string, any> | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/supplyConsume/chamber`, { data }, { headers: { noLoading: false } }, cb);

// 供应与使用查询单个机台 （fab 机台）
export const queryFabSupplyConsumeOneChamber = (data?: Record<string, any> | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/supplyConsume/fabOne`, { data }, { headers: { noLoading: false } }, cb);

// chamber跑片历史记录 （fab 机台）
export const queryFabSupplyConsumeChamberRunRecord = (data?: Record<string, any> | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/supplyConsume/page/chamber/run`, { data }, { headers: { noLoading: false } }, cb);

// 机台状态下拉 （fab 机台）
export const getFabStatusOptions = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/status/list`, { params }, { headers: { noLoading: true } }, cb);

// 工艺下拉框 （fab 工艺查询）
export const getFabTechnologySelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>(
    "get",
    `/fab/api/v1/supplyConsume/technology/select`,
    { params },
    { headers: { noLoading: true } },
    cb
  );

// 产品下拉框 （fab 工艺查询）
export const getFabProductSelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>(
    "get",
    `/fab/api/v1/supplyConsume/product/select`,
    { params },
    { headers: { noLoading: true } },
    cb
  );

// lot筛选 （fab 工艺查询）
export const getFabLotSelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>(
    "get",
    `/fab/api/v1/supplyConsume/lot/select`,
    { params },
    { headers: { noLoading: true } },
    cb
  );

// Wafer筛选 （fab 工艺查询）
export const getFabWaferSelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>(
    "get",
    `/fab/api/v1/supplyConsume/wafer/select`,
    { params },
    { headers: { noLoading: true } },
    cb
  );

// 系统树下拉material  物料选择 （fab 工艺查询）
export const getMaterialTreeData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/publish/list/system/material`, { params }, { headers: { noLoading: true } }, cb);

// 供应与使用查询按照工艺（工艺机台关联查询） （fab 工艺查询）
export const queryFabTechnologyAndEqp = (data?: Record<string, any> | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/supplyConsume/technologyAndEqp`, { data }, { headers: { noLoading: false } }, cb);

// 机台区域枚举 （fab 机台监控 spec设定 ）
export const getFabAreaSelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>("get", `/fab/api/v1/fab/area`, { params }, { headers: { noLoading: true } }, cb);

// 看板-配置项 （fab 机台总览 看板 ）
export const getFabBoardConfigSelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Array<any>>>("get", `/fab/api/v1/board/eqp/board/config`, { params }, { headers: { noLoading: true } }, cb);

// 看板-耗量区域占比统一接口 （fab 机台总览 看板 ）
export const getFabBoardPieData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/consume/area`, { params }, { headers: { noLoading: true } }, cb);

// 看板-耗量统计统一接口 （fab 机台总览 看板 ）
export const getFabBoardBarData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/consume/day/seven`, { params }, { headers: { noLoading: true } }, cb);

// 看板-水课废水和气化下拉选择 （fab 机台总览 看板 ）
export const getFabBoardSelectOptions = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/system/select`, { params }, { headers: { noLoading: true } }, cb);

// 看板-废液排放量 （fab 机台总览 看板 ）
export const getFabBoardEffluentData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/24/emsSpec`, { params }, { headers: { noLoading: true } }, cb);

// 看板-各科关联机台数量 （fab 机台总览 看板 ）
export const getFabBoardCountData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/class/relation`, { params }, { headers: { noLoading: true } }, cb);

// 看板-今日机台状态统计 （fab 机台总览 看板 ）
export const getFabBoardStatusData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/now/status`, { params }, { headers: { noLoading: true } }, cb);

// 看板-机台区域饼图统计 （fab 机台总览 看板 ）
export const getFabBoardAreaData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/distribute`, { params }, { headers: { noLoading: true } }, cb);

// 看板-今日机台保养任务 （fab 机台总览 看板 ）
export const getFabBoardPMTaskData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/day/pm`, { params }, { headers: { noLoading: true } }, cb);

// 看板-今日机台维修任务 （fab 机台总览 看板 ）
export const getFabBoardMaintainTaskData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/day/maintain`, { params }, { headers: { noLoading: true } }, cb);

// 看板-今日机台异常告警 （fab 机台总览 看板 ）
export const getFabBoardAlarmData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/day/alarm`, { params }, { headers: { noLoading: true } }, cb);

// 看板-看板-耗量统计统一接口 （fab 机台总览 看板 ）
export const getFabBoardOneDayData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/consume/day/hour/24`, { params }, { headers: { noLoading: true } }, cb);

// 看板-耗量区域占比 机台弹窗 （fab 机台总览 看板 ）
export const getFabBoardOneDayAreaData = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/fab/api/v1/board/eqp/consume/area/eqp`, { params }, { headers: { noLoading: true } }, cb);

// chamber跑片历史记录 （fab 公共查询平台 ）
export const queryFabCommonQueryWafer = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/common/select/page/chamber/run`, { data }, { headers: { noLoading: true } }, cb);

// 作业看板 （fab 公共查询平台 ）
export const queryFabCommonQueryBoard = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/common/select/page/homework/board`, { data }, { headers: { noLoading: true } }, cb);

// 异常事件 （fab 公共查询平台 ）
export const queryFabCommonQueryAlarm = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/common/select/page/alarm/work`, { data }, { headers: { noLoading: true } }, cb);

// 运营计划 （fab 公共查询平台 ）
export const queryFabCommonQueryOperationPlan = (data?: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/common/select/select/operational/plan`, { data }, { headers: { noLoading: true } }, cb);

// 新进机台计划 （fab 公共查询平台 ）
export const queryFabCommonQueryFabPlan = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/common/select/page/in/eqp/plan`, { data }, { headers: { noLoading: true } }, cb);

// 查询SPC指标列表 （fab 机台监控 spec设定 ）
export const queryFabSPECList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/spcIndicator/queryList`, { data }, { headers: { noLoading: true } }, cb);

// 删除SPC指标设定  （fab 机台监控 spec设定 ）
export const removeFabSPEC = (id: string | number | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/spcIndicator/delete`, { data: { id } }, { headers: { noLoading: true } }, cb);

// 查询SPC指标详情  （fab 机台监控 spec设定 ）
export const queryFabSPECDetail = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>("post", `/fab/api/v1/spcIndicator/queryDetail`, { data }, { headers: { noLoading: true } }, cb);

// 导入spec  （fab 机台监控 spec设定 ）
export const importFabSPECData = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault>(
    "post",
    `/fab/api/v1/spcIndicator/list/import`,
    { data },
    { headers: { noLoading: true, "Content-Type": "multipart/form-data" } },
    cb
  );

// 关联过的机台id的查询  （fab 机台监控 spec设定 ）
export const getRelatedFabId = (fabName: string | undefined, cb?: (err: any) => any) =>
  http.request<Array<string>>("get", `/fab/api/v1/spcQuota/getFab/${fabName}`, {}, { headers: { noLoading: false } }, cb);

// 根据机台查询该机台下绑定的所有的指标 （fab 机台监控 spec设定 ）
export const queryRelatedFabQuotaList = (eqpId: string | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableType>>("get", `/fab/api/v1/spcQuota/get/quotaList?eqpId=${eqpId}`, {}, { headers: { noLoading: true } }, cb);

// 新增SPC指标设定 （fab 机台监控 spec设定 ）
export const createFabSPEC = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/spcIndicator/add`, { data }, { headers: { noLoading: true } }, cb);

// 更新SPC指标设定 （fab 机台监控 spec设定 ）
export const editFabSPEC = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/spcIndicator/update`, { data }, { headers: { noLoading: true } }, cb);

// 内容设定列表分页查询 （fab 机台监控 内容设定 ）
export const queryFabSPECContentList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/spcQuota/page/spcQuota`, { data }, { headers: { noLoading: true } }, cb);

// 机台柱位 （fab 机台监控 内容设定 ）
export const queryFabPillarSelectOptions = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/spcQuota/list/space`, { data }, { headers: { noLoading: true } }, cb);

// 更新关注内容 （fab 机台监控 内容设定 ）
export const updateFabSPECContent = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/spcQuota/update/spcQuotaList`, { data }, { headers: { noLoading: true } }, cb);

// 分页查询Fab机台所有信息，第二版变更 （fab 机台列表 机台详情 ）
export const queryFabListNew = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/eqp/page`, { data }, { headers: { noLoading: true } }, cb);

// 导入机台台账 （fab 机台列表 机台详情 ）
export const importFabDataList = (data?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>(
    "post",
    `/fab/api/v1/importData`,
    { data },
    { headers: { noLoading: true, "Content-Type": "multipart/form-data" } },
    cb
  );

// 机台实时参数 （fab 机台列表 机台详情 ）
export const queryFabDetailParams = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("post", `/fab/api/v1/fab/realTimeParameters`, { data }, { headers: { noLoading: true } }, cb);

// 机台实时参数24小时spec线 （fab 机台列表 机台详情 ）
export const queryFabDetailParamsSpec = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/fab/24/spec`, { data }, { headers: { noLoading: true } }, cb);

// 机台状态转换信息 （fab 机台列表 机台详情 ）
export const queryFabDetailParamsStatus = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("post", `/fab/api/v1/fab/state/change`, { data }, { headers: { noLoading: true } }, cb);

// 机台PM任务 当前任务分页查询 （fab pm任务 ）
export const queryFabCurrentPm = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/pm/eqp/job/current/page`, { data }, { headers: { noLoading: true } }, cb);

// 机台PM任务 历史任务分页查询 （fab pm任务 ）
export const queryFabHistoryPm = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/pm/eqp/job/old/page`, { data }, { headers: { noLoading: true } }, cb);

// 机台保养信息详情 （fab pm任务 ）
export const queryFabPmDetail = (params = null, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("get", `/fab/api/v1/pm/eqp/job/detail`, { params }, { headers: { noLoading: true } }, cb);

// 机台保养信息详情 （fab pm任务 ）
export const createFabPm = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<TableType>("post", `/fab/api/v1/pm/note/add`, { data }, { headers: { noLoading: true } }, cb);

// planNo模糊下拉 （fab pm任务 ）
export const queryFabPlanNoList = (params = null, cb?: (err: any) => any) =>
  http.request<Array<string>>("get", `/fab/api/v1/pm/eqp/planNo/list`, { params }, { headers: { noLoading: false } }, cb);

// jobNo模糊下拉 （fab pm任务 ）
export const queryFabJobNoList = (params = null, cb?: (err: any) => any) =>
  http.request<Array<string>>("get", `/fab/api/v1/pm/eqp/jobNo/list`, { params }, { headers: { noLoading: false } }, cb);

// job状态下拉 （fab pm任务 ）
export const queryFabJobStatusList = (cb?: (err: any) => any) =>
  http.request<Array<string>>("get", `/fab/api/v1/pm/eqp/job/status/list`, {}, { headers: { noLoading: false } }, cb);

// 新增pm任务评论 （fab pm任务 ）
export const createFabPMNotes = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/pm/note/add`, { data }, { headers: { noLoading: true } }, cb);

// 编辑pm任务评论 （fab pm任务 ）
export const editFabPMNotes = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/pm/note/update`, { data }, { headers: { noLoading: true } }, cb);

// 删除pm任务评论 （fab pm任务 ）
export const deleteFabPMNotes = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/pm/note/delete`, { data }, { headers: { noLoading: true } }, cb);

// 模糊查询设备信息 （fab pm计划 ）
export const queryDeviceList = (deviceName: string | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableType>>("get", `/fab/api/v1/pm/device/getDevice/${deviceName}`, {}, { headers: { noLoading: true } }, cb);

// 模糊查询设备区域信息 （fab pm计划 ）
export const queryPositionList = (position: string | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableType>>("get", `/fab/api/v1/pm/device/getDevice/position/${position}`, {}, { headers: { noLoading: true } }, cb);

// status下拉 （fab pm计划 ）
export const queryFactoryStatusOptions = (params = null, cb?: (err: any) => any) =>
  http.request<Array<TableType>>("get", `/fab/api/v1/pm/device/status/list`, { params }, { headers: { noLoading: true } }, cb);

// 拓扑图弹窗-指标数据折线图 （fab 拓扑图 cl2 ）
export const queryFabTodayData = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<Record<string, any>>>("post", `/fab/api/v1/pid/eqp/todayConsume`, { data }, { headers: { noLoading: true } }, cb);
